<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2020/1/13
 * Time: 14:40
 */
namespace app\api\model;
use think\Model;

class ValidateCode extends Model
{
    protected $table = 'validate_code'; //设置表名

    //设置需要自动插入的字段及值
    protected $insert = ['create_time','create_ip'];
    public function setCreateTimeAttr(){
        return date("Y-m-d H:i:s");
    }

    public function setCreateIpAttr(){
        return request()->ip();
    }
}